<?php
    include 'init.php';

    //接收用户要修改相册id
    $id = $_GET['id'];

    //通过相册id查询出相册的名称
    $sql = "select name from album where id='$id'";

    $result = mysql_query($sql);

    //直接拿到相册名称
    $name = mysql_fetch_assoc($result);
    $name = $name['name'];

    //关闭数据连接
    mysql_close($link);
?>
<!doctype html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>Edit_album</title>
    </head>
    <body>
        <form action="do_edit.php" method="post">
            <!-- 通过隐藏域把相册id传到do_edit.php文件中作为where条件 -->
            <input type="hidden" name="album_id" value="<?php echo $id ?>" />

            相册名:
            <input type="text" name="name" value="<?php echo $name; ?>" /><br/>

            <input type="submit" value="修改" />
        </form>
    </body>
</html>
